﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//
using Model;
using DAL;

namespace BLL
{
    public class UsersBLL
    {
        UsersDAL dal = new UsersDAL();
        //注册
        public bool Add(Users u)
        {
            return dal.Add(u);
        }

        //登录
        public Users Login(string uname, string pwd)
        {
            return dal.Login(uname, pwd);
        }

        //查询所有用户
        public List<Users> GetAll()
        {
            return dal.GetAll();
        }
        //查询指定用户
        public Users GetUserByID(int? id)
        {
            return dal.GetUserByID(id);
        }
        //查询指定用户的帖子
        public List<Articles> GetArticlesByID(int id)
        {
            return dal.GetArticlesByID(id);
        }
        //修改密码
        public bool UpdatePwd(Users update)
        {
            return dal.UpdatePwd(update);
        }
    }
}
